<!-- $Id: brand_info.htm 14216 2008-03-10 02:27:21Z testyang $ -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>ECSHOP 管理中心 - 添加品牌 </title>
        <meta name="robots" content="noindex, nofollow"/>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link href="__CSS__/general.css" rel="stylesheet" type="text/css" />
        <link href="__CSS__/main.css" rel="stylesheet" type="text/css" />
        <css href='__UPLOADIFY__/common.css'/>
        <style type="text/css" >
        </style>
    </head>
    <body>
        <h1>
            <span class="action-span"><a href="{:U('index')}">商品品牌</a></span>
            <span class="action-span1"><a href="#">ECSHOP 管理中心</a></span>
            <span id="search_id" class="action-span1"> - 添加品牌 </span>
        </h1>
        <div style="clear:both"></div>
        <div class="main-div">
            <form method="post" action="{:U()}" enctype="multipart/form-data" >
                <table cellspacing="1" cellpadding="3" width="100%">
                    <tr>
                        <td class="label">品牌名称</td>
                        <td>
                            <input type="text" name="name" maxlength="60" value="{$row.name}" />
                            <span class="require-field">*</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">LOGO</td>
                        <td>
                            <input type="hidden" name="logo" id="logo" value="{$row.logo}"/>
                            <input type="file" id="logo_file" />
                            <img src="{$row.logo}" id="logo_preview" width="100" style="display:block;"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">品牌描述</td>
                        <td>
                            <textarea  name="intro" cols="60" rows="4"  >{$row.intro}</textarea>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">排序</td>
                        <td>
                            <input type="text" name="sort" maxlength="40" size="15" value="{$row.sort|default=50}" />
                        </td>
                    </tr>
                    <tr>
                        <td class="label">是否显示</td>
                        <td>
                            <input type="radio" name="status" value="1" class="status"/> 是
                            <input type="radio" name="status" value="0" class="status" /> 否(当品牌下还没有商品的时候，首页及分类页的品牌区将不会显示该品牌。)
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center"><br />
                            <input type="hidden" name="id" value="{$row.id}" />
                            <input type="submit" class="button" value=" 确定 " />
                            <input type="reset" class="button" value=" 重置 " />
                        </td>
                    </tr>
                </table>
            </form>
        </div>

        <div id="footer">
            共执行 1 个查询，用时 0.018952 秒，Gzip 已禁用，内存占用 2.197 MB<br />
            版权所有 &copy; 2005-2012 上海商派网络科技有限公司，并保留所有权利。
        </div>
    <js href='__JS__/jquery.min.js'/>
    <js href='__UPLOADIFY__/jquery.uploadify.min.js'/>
    <js href='__LAYER__/layer.js'/>

    <script type='text/javascript'>
        $(function(){
            //回显品牌状态
            $('.status').val([{$row.status|default=1}]);
                
            //使用uploadify初始化logo文件框
            $options = {
                swf:'__UPLOADIFY__/uploadify.swf',
                uploader:'{:U("Upload/uploadImg")}',
//                buttonClass:'kunx',
                buttonText:' 选择文件 ',
                fileObjName:'file_data',
                onUploadSuccess:function(file_item,response){
                    //根据返回的status来判定是否成功
                    var data = $.parseJSON(response);
                    if(data.status){
                        $('#logo').val(data.file_url);
                        $('#logo_preview').attr('src',data.file_url);
                        layer.alert(data.msg, {icon: 6});
                    }else{
//                        alert(data.msg);
                        layer.alert(data.msg, {icon: 5});
                    }
                },
            };
            $('#logo_file').uploadify($options);
                
        });
    </script>
    </body>
</html>